using System;
using System.Collections;
using Refly.CodeDom;
using Refly.CodeDom.Statements;
using Refly.CodeDom.Collections;
using Refly.Templates;
using Refly.CodeDom.Expressions;
using System.Text;
using System.Text.RegularExpressions;
using Reflector;
using Reflector.CodeModel;
using Reflector.Framework;
using System.ComponentModel;
using Doubler.Helpers;

namespace Doubler.Templates
{
    public abstract class TemplateBase : Template, ITemplate
    {

        private Reflector.CodeModel.ITypeDeclaration _Subject;
        private ReflectorServices _Services;

        [Browsable(false)]
        public ReflectorServices Services
        {
            get
            {
                return _Services;
            }
            set
            {
                _Services = value;
                MetaHelper.Services = value;
            }
        }

        [Browsable(false)]
        public abstract string OutputFilePath { get;}

        [Browsable(false)]
        public abstract string FileName {get;}

        public TemplateBase()
            : base("", "Double{0}")
        {
            
        }

        public TemplateBase(string templateName, string nameFormat)
            : base(templateName, nameFormat)
        {
            
        }

        public TemplateBase(CodeLanguage language, string outDirectoryPath, string nameFormat, ReflectorServices reflectorServices)
            : base("", nameFormat)
        {
            this.OutputLanguage = language;
            this.OutputPath = outDirectoryPath;
            this.Services = reflectorServices;
        }
    }
}
